home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibsigs.lbr / TESTINVF.PQS / testinvf.pas
Pascal/Delphi Source File  |  1985-05-06  |  2KB  |  65 lines

  1. (*--------------------------------------------------------------------------*)
  2. (*                 TestInvF --- Test inverse F routine                      *)
  3. (*--------------------------------------------------------------------------*)
  4.  
  5. PROGRAM TestInvf;
  6.  
  7. (*--------------------------------------------------------------------------*)
  8. (*                                                                          *)
  9. (*   Program:  TestInvF                                                     *)
  10. (*                                                                          *)
  11. (*   Purpose:  Demonstrate inverse F routine in PIBSIGS                     *)
  12. (*                                                                          *)
  13. (*   Usage:    This program prompts for a p-value and numerator and         *)
  14. (*             denominator degrees of freedom.  It computes and prints      *)
  15. (*             the corresponding percentage point of the central F          *)
  16. (*             distribution.                                                *)
  17. (*                                                                          *)
  18. (*             Note:  the input probability is the tail value, not the      *)
  19. (*                    cumulative probability.                               *)
  20. (*                                                                          *)
  21. (*             To stop the program, enter a p-value of -99.                 *)
  22. (*                                                                          *)
  23. (*   Calls:    Finv                                                         *)
  24. (*                                                                          *)
  25. (*--------------------------------------------------------------------------*)
  26.  
  27. VAR
  28.    F:    REAL;
  29.    Dfh:  REAL;
  30.    Dfe:  REAL;
  31.    P:    REAL;
  32.    Done: BOOLEAN;
  33.  
  34. (*$I SIGCONST.PAS *)
  35. (*$I LOGTEN.PAS   *)
  36. (*$I POWERI.PAS   *)
  37. (*$I POWTEN.PAS   *)
  38. (*$I ALGAMA.PAS   *)
  39. (*$I CDBETA.PAS   *)
  40. (*$I NINV.PAS     *)
  41. (*$I BETAINV.PAS  *)
  42. (*$I FINV.PAS     *)
  43.  
  44. BEGIN (* TestInvf *)
  45.  
  46.    Done := FALSE;
  47.    ClrScr;
  48.  
  49.    REPEAT
  50.  
  51.       WRITE('Enter tail prob., num. and den. DF (-99 to stop):  ');
  52.       READLN( P, Dfh, Dfe );
  53.  
  54.       IF ( P > 0.0 ) THEN
  55.          BEGIN
  56.             F     := Finv( P, Dfh, Dfe );
  57.             WRITELN('F percentage point = ',F:12:5);
  58.          END
  59.       ELSE
  60.          Done := TRUE;
  61.  
  62.    UNTIL Done;
  63.  
  64.  
  65. END   (* TestInvf *).